package com.zhangshanfeng.test2;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie extends Thread {
    private ArrayBlockingQueue<String> bd;

    public Foodie(ArrayBlockingQueue<String> bd) {
        this.bd = bd;
    }

    @Override
    public void run() {
        while(true){
            try {
                bd.take();
                System.out.println("小黑吃了一个热狗");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }


        }
    }
}
